import React from 'react';
/**
 * 虚拟dom为什么比真实dom高效？
 * 评判谁更高效？看谁身上携带的属性更少
 */
class Virtual extends React.Component {
    render() { 
        return <div></div>;
    }
}

const virtualDOM = React.createElement('div');
const realDOM = document.createElement('div');

let virtualNum = 0;
let realNum = 0;

for(let key in virtualDOM){
    virtualNum++;
}

for(let key in realDOM){
    realNum++;
}

console.log('虚拟dom携带：', virtualNum);
console.log('真实dom携带：', realNum);
 
export default Virtual;